// @ts-nocheck
/**
 * @Date: 2022-03-10 20:01:52
 * @LastEditors: sailornpg
 * @LastEditTime: 2022-03-14 11:23:46
 * @FilePath: \zhihuReal\model\questionMdl.js
 * @Description: 问题Schema
 */
const {
    Schema
} = require('../db/db')
const mongoose = require('../db/db')
const questionSchema = mongoose.Schema({
    __v: {
        type: Number,
        select: false
    },
    title: {
        type: String,
        required: true
    },
    desc: {
        type: String,
        required: true
    },
    questioner: {
        type: Schema.Types.ObjectId,
        ref: 'User',
        select: false,
        required: true,

    },
    //问题对应话题
    topics: {
        type: [{
            type: Schema.Types.ObjectId,
            ref: 'Topic',
        }],
        select: false,
    }
}, {
    timestamps: true
})
const Question = mongoose.model('Question', questionSchema)
module.exports = Question